//
//  ZYNewtransferViewController.swift
//  GZWeibo007
//
//  Created by apple on 15/12/24.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit

class ZYNewtransferViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.parentViewController?.tabBarController?.tabBar.hidden = true
       perpraUI()
        
        
      }
    
    var status: CZStatus? {
        didSet {
            topView.status = status
            
            
        }
    }

    func perpraUI(){
        view.addSubview(topView)
        view.addSubview(midstView)
        view.addSubview(bottomView)
        
//        topView.translatesAutoresizingMaskIntoConstraints = false
//        midstView.translatesAutoresizingMaskIntoConstraints = false
//        bottomView.translatesAutoresizingMaskIntoConstraints = false
//        let button :CGFloat = 44
        topView.ff_AlignInner(type: ff_AlignType.TopLeft, referView: view, size: CGSizeMake(UIScreen.mainScreen().bounds.width,UIScreen.mainScreen().bounds.height*0.5 ))
        bottomView.ff_AlignInner(type: ff_AlignType.BottomLeft, referView: view, size: CGSizeMake(UIScreen.mainScreen().bounds.width, 44))
////        midstView.ff_AlignHorizontal(type: ff_AlignType.CenterLeft, referView: view, size: CGSizeMake(UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height - ))
//        view.addConstraint(NSLayoutConstraint(item: topView, attribute: NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: view, attribute: NSLayoutAttribute.Top, multiplier: 1, constant: 0))
//        view.addConstraint(NSLayoutConstraint(item: topView, attribute: NSLayoutAttribute.Bottom, relatedBy: NSLayoutRelation.Equal, toItem: midstView, attribute: NSLayoutAttribute.Bottom, multiplier: 1, constant: 0))
//        view.addConstraint(NSLayoutConstraint(item: topView, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 0, constant: UIScreen.mainScreen().bounds.height*0.5))
//        view.addConstraint(NSLayoutConstraint(item: topView, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 0, constant: UIScreen.mainScreen().bounds.width))
//        
//        view.addConstraint(NSLayoutConstraint(item: midstView, attribute: NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: topView, attribute: NSLayoutAttribute.Top, multiplier: 1, constant: 20))
//        view.addConstraint(NSLayoutConstraint(item: midstView, attribute: NSLayoutAttribute.Bottom
//            , relatedBy: NSLayoutRelation.Equal, toItem: bottomView, attribute: NSLayoutAttribute.Bottom, multiplier: 1, constant: 20))
//        view.addConstraint(NSLayoutConstraint(item: midstView, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 0, constant: UIScreen.mainScreen().bounds.height - UIScreen.mainScreen().bounds.height*0.5 - button))
//        view.addConstraint(NSLayoutConstraint(item: midstView, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 0, constant: UIScreen.mainScreen().bounds.width))
//        
//        view.addConstraint(NSLayoutConstraint(item: bottomView, attribute: NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: view, attribute: NSLayoutAttribute.Top, multiplier: 1, constant: 0))
//        view.addConstraint(NSLayoutConstraint(item: bottomView, attribute: NSLayoutAttribute.Bottom, relatedBy: NSLayoutRelation.Equal, toItem: view, attribute: NSLayoutAttribute.Bottom, multiplier: 1, constant: 0))
//        view.addConstraint(NSLayoutConstraint(item: bottomView, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier:0, constant: UIScreen.mainScreen().bounds.width))
//        view.addConstraint(NSLayoutConstraint(item: bottomView, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 0, constant: button))
        
        
    }
    
    private lazy var topView : CZStatusNormalCell = {
//        let topView = CZStatusNormalCell()
        let topView = CZStatusNormalCell()
        topView.backgroundColor = UIColor.yellowColor()

        return topView
    }()
    
    private lazy var midstView :UITableView = UITableView()
    
    private lazy var bottomView :CZStatusBottomView = CZStatusBottomView()
    
    
}
 